package com.zch.socket.socket.client;


import com.zch.socket.aio.client.ClientProvider;
import com.zch.socket.aio.client2.Client;
import org.junit.Test;

import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ClientSocket {
    ExecutorService threadPool = Executors.newFixedThreadPool(8);

    /**
     * 传统的socket通信默认是一次通信，哪怕没有显示的关闭socket，一次通信完后也会自动关闭
     * @throws Exception
     */
    @Test
    public void test1() throws Exception{
        ClientTask clientTask =new ClientTask("localhost",1066);
        System.out.println("请输入请求消息：");
        Scanner scanner = new Scanner(System.in);
        while(true){
            clientTask.sendMsg("1");
            clientTask.sendMsg("2");
            clientTask.sendMsg("3");
            clientTask.sendMsg("4");
            clientTask.sendMsg("5");
        }

        }

    }

